

import request from '@/utils/requist'
 


// 获取权限
// export const FontPermission = () => {
//   return request({
//     method: 'post',
//     url:  '/api/carrier/FontPermission',
//     data: {}
//   })
// }

// 模板下载 --- 三载体共用
export const DownloadTemplate = ({ template_type, token }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/DownloadTemplate',
    data: {
      template_type, token
    }
  })
}
// 导入文件 --- 三载体共用
export const UploadCarrierData = (file) => {
  return request({
    method: 'post',
    url:  '/api/carrier/UploadCarrierData',
    data: file
  })
}

// 批量导出 --- 楼宇
export const BatchExport = ({ select_id_list, token }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/BatchExport',
    data: {
      select_id_list, token
    }
  })
}
// 批量导出 --- 厂房
export const BatchExportFactory = ({ select_id_list, token }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/BatchExportFactory',
    data: {
      select_id_list, token
    }
  })
}
// 批量导出 --- 土地
export const BatchExportLand = ({ select_id_list, token }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/BatchExportLand',
    data: {
      select_id_list, token
    }
  })
}

// 搜索 --- 楼宇
export const SearchCarrier = ({
  token,
  page,
  per_page,
  build_name,
  // owner,
  district_name,
  build_type,
}) => {
  return request({
    method: 'post',
    url:  '/api/carrier/SearchCarrier',
    data: {
      token,
      page,
      per_page,
      build_name,
      // owner,
      district_name,
      build_type,
    }
  })
}
// 搜索 --- 土地
export const SearchCarrierLand = ({
  token,
  page,
  per_page,
  land_name,
  land_code,
  district_name,
  // land_status,
}) => {
  return request({
    method: 'post',
    url:  '/api/carrier/SearchCarrierLand',
    data: {
      token,
      page,
      per_page,
      land_name,
      land_code,
      district_name,
      // land_status,
    }
  })
}
// 搜索 --- 厂房
export const SearchCarrierFactory = ({
  token,
  page,
  per_page,
  factory_name,
  // owner,
  district_name,
  is_standard,
}) => {
  return request({
    method: 'post',
    url:  '/api/carrier/SearchCarrierFactory',
    data: {
      token,
      page,
      per_page,
      factory_name,
      // owner,
      district_name,
      is_standard,
    }
  })
}

// 批量删除 --- 三载体共用
export const BatchDelete = ({ delete_id_list, token, carrier_type }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/BatchDelete',
    data: {
      delete_id_list, token, carrier_type
    }
  })
}

// 批量审核
export const BatchAudit = ({ audit_flag, audit_id_list, audit_message, token, carrier_type }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/BatchAudit',
    data: {
      audit_flag, audit_id_list, audit_message, token, carrier_type
    }
  })
}

// 编辑 查看 详情
export const CheckDetail = ({ id, carrier_type }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/CheckDetail',
    data: {
      id, carrier_type
    }
  })
}
// 编辑 查看 详情
export const CarrierLandStatus = ({ token, land_id, land_status }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/CarrierLandStatus',
    data: {
      token, land_id, land_status
    }
  })
}

// 修改详情 -- 楼宇
export const CarrierEdit = ({
  token,
  id,
  district_name,
  build_name,
  build_type,
  detail_address,
  construction_time,
  cover_land_area,
  build_area,
  empty_area,
  layer_num,
  car_space_num,
  lift_num,
  attract_status,
  cooperation_model,
  rent_money,
  wuye_money,
  linkman,
  link_mobile,
  attract_advantage,
  policy, }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/CarrierEdit',
    data: {
      token,
      id,
      district_name,
      build_name,
      build_type,
      detail_address,
      construction_time,
      cover_land_area,
      build_area,
      empty_area,
      layer_num,
      car_space_num,
      lift_num,
      attract_status,
      cooperation_model,
      rent_money,
      wuye_money,
      linkman,
      link_mobile,
      attract_advantage,
      policy,
    }
  })
}
// 修改详情 -- 厂房
export const CarrierEditFactory = ({
  token,
  factory_id,
  district_name,
  factory_name,
  is_standard,
  detail_address,
  construction_time,
  cover_land_area,
  factory_area,
  empty_area,
  layer_num,
  factory_structure,
  width,
  high,
  bearing,
  is_water,
  is_electric,
  is_warm,
  is_gas,
  is_network,
  lift_num,
  attract_status,
  cooperation_model,
  rent_money,
  linkman,
  link_mobile,
  attract_advantage,
  policy,

}) => {
  console.log({
    token,
    factory_id,
    district_name,
    factory_name,
    is_standard,
    detail_address,
    construction_time,
    cover_land_area,
    factory_area,
    empty_area,
    layer_num,
    factory_structure,
    width,
    high,
    bearing,
    is_water,
    is_electric,
    is_warm,
    is_gas,
    is_network,
    lift_num,
    attract_status,
    cooperation_model,
    rent_money,
    linkman,
    link_mobile,
    attract_advantage,
    policy,
  })
  return request({
    method: 'post',
    url:  '/api/carrier/CarrierEditFactory',
    data: {
      token,
      factory_id,
      district_name,
      factory_name,
      is_standard,
      detail_address,
      construction_time,
      cover_land_area,
      factory_area,
      empty_area,
      layer_num,
      factory_structure,
      width,
      high,
      bearing,
      is_water,
      is_electric,
      is_warm,
      is_gas,
      is_network,
      lift_num,
      attract_status,
      cooperation_model,
      rent_money,
      linkman,
      link_mobile,
      attract_advantage,
      policy,


    }
  })
}
// 修改详情 -- 土地
export const CarrierEditLand = ({
  token,
  land_id,
  district_name,
  link_mobile,
  land_name,
  detail_address,
  land_code,
  land_nature,
  land_status,
  linkman,
  total_area,
  plot_ratio,
  jing_area,
  sales_price,
  max_sales_price,
  max_car_space_price,
  transfer_year,
  industry_type,
  rent_money,
  plan_target, }) => {
  return request({
    method: 'post',
    url:  '/api/carrier/CarrierEditLand',
    data: {

      token,
      land_id,
      district_name,
      link_mobile,
      land_name,
      detail_address,
      land_code,
      land_nature,
      land_status,
      linkman,
      total_area,
      plot_ratio,
      jing_area,
      sales_price,
      max_sales_price,
      max_car_space_price,
      transfer_year,
      industry_type,
      rent_money,
      plan_target,
    }
  })
}

// 获取数据列表
export const ShowAll = ({
  token,
  page,
  per_page,
  carrier_type
}) => {
  return request({
    method: 'post',
    url:  '/api/carrier/ShowAll',
    data: {
      token,
      page,
      per_page,
      carrier_type
    }
  })
}

// 获取日志列表
export const ShowLog = ({
  token,
  filter_time,
  page,
  per_page,
  pop_flag
}) => {
  return request({
    method: 'post',
    url:  '/api/carrier/ShowLog',
    data: {
      token,
      filter_time,
      page,
      per_page,
      pop_flag

    }
  })
}
// 上传图片
export const UploadBuildPicture = (file) => {
  return request({
    method: 'post',
    url:  '/api/carrier/UploadBuildPicture',
    data: file
  })
}
// 产业地图---中部面积展示
export const ShowArea = ({
  district_name
}) => {
  return request({
    method: 'post',
    url:  '/api/carrier/ShowArea',
    data: {
      district_name
    }
  })
}
// 产业地图---右部悬框数据
export const ShowCarrierEnergy = () => {
  return request({
    method: 'get',
    url:  '/api/carrier/ShowCarrierEnergy',
  })
}

// 产业地图---中部面积展示
export const ShowCarrierRate = ({
  district_name
}) => {
  return request({
    method: 'post',
    url:  '/api/carrier/ShowCarrierRate',
    data: {
      district_name
    }
  })
}
// 产业地图---中部面积展示
export const GetLoansRate = () => {
  return request({
    method: 'get',
    url:  '/api/carrier/GetLoansRate',
  })
}


// 选址评估---搜索土地
export const SearchLand = ({
  district_name,
  land_name,
  land_nature,
  industry_name,
  total_area_id,
  transfer_year_id,
  key_words,
  page,
  per_page,
}) => {

  return request({
    method: 'post',
    url:  '/api/carrier/SearchLand',
    data: {
      district_name,
      land_name,
      land_nature,
      industry_name,
      total_area_id,
      transfer_year_id,
      key_words,
      page,
      per_page,
    }
  })
}

// 选址评估---搜索厂房
export const SearchFactory = ({
  district_name,
  factory_name,
  industry_name,
  property_type,
  key_words,
  surround_facility,
  rent_status,
  page,
  per_page,
}) => {

  return request({
    method: 'post',
    url:  '/api/carrier/SearchFactory',
    data: {
      district_name,
      factory_name,
      industry_name,
      property_type,
      key_words,
      surround_facility,
      rent_status,
      page,
      per_page,
    }
  })
}

// 选址评估---搜索楼宇
export const SearchBuild = ({
  key_words,
  district_name,
  build_name,
  build_type,
  page,
  per_page,
  industry_name,
  total_area_id,
  rent_rate,
}) => {


  return request({
    method: 'post',
    url:  '/api/carrier/SearchBuild',
    data: {
      key_words,
      district_name,
      build_name,
      build_type,
      page,
      per_page,
      industry_name,
      total_area_id,
      rent_rate,
    }
  })
}

// 选址评估---全部
export const SearchAll = ({
  key_words,
  carrier_name,
  carrier_type_id,
  district_name,
  carrier_address,
  industry_name,
  cover_land_area_id,
  page,
  per_page,
}) => {

  return request({
    method: 'post',
    url:  '/api/carrier/SearchAll',
    data: {
      key_words,
      carrier_name,
      carrier_type_id,
      district_name,
      carrier_address,
      industry_name,
      cover_land_area_id,
      page,
      per_page,
    }
  })
}

